package com.thl.openfeign.fallback;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.thl.openfeign.StudentFeignClient;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StudentFeignClientFallbackFactory implements FallbackFactory<StudentFeignClient> {
    @Override
    public StudentFeignClient create(Throwable cause) {
        return new StudentFeignClient() {
            @Override
            public AjaxResult getInfo(Long id) {
                return AjaxResult.error("StudentFeignClient调用失败");
            }
        };
    }
}
